package kr.hkit.powerjava.chapter22.collection;

import java.util.Collections;
import java.util.LinkedList;

public class LinkedListTest {
	public static void main(String[] args) {
		LinkedList<String> arlist = new LinkedList<>();
		arlist.add("milk");
		arlist.add("bread");
		arlist.add("butter");

		arlist.add(1, "apple");

		arlist.set(2, "grape");

		String temp = arlist.remove(0);

		System.out.println("제거된 문자열" + temp);

		Collections.sort(arlist);

		for (String str : arlist) {
			System.out.println(str);
		}

	}
}
